package main

import (
	"fmt"
	"sort"
)

func getLeastNumbers(arr []int, k int) []int {
	sort.Ints(arr)
	fmt.Printf("%d", arr)
	return arr[0:k]
}

func main() {
	nums := [...]int{4, 5, 1, 6, 2, 7, 3}
	k := 3
	fmt.Printf("nums is %d\n", nums)
	num := getLeastNumbers(nums[:], k)
	fmt.Printf("num is %d\n", num)
}
